Count Property (AddressLists Collection)
The Count
property returns the number of AddressList objects in the collection.
Read-only.
Syntax
objAddrListsColl.Count
Data Type
Long
Example
This code
fragment uses the Count and Item
Dim i As Integer ' loop counter
Set hierarchy = MAPI.Session.AddressLists
' make sure returned collection object is valid
If hierarchy Is Nothing Then
' Exit
"Address book hierarchy is invalid"
End If
' see if hierarchy is empty
i = hierarchy.Count ' count of address books in
hierarchy
If 0 = i Then
' Exit
"No available address books"
End If
' precautionary loop to make sure address books are
all valid
For i = 1 To hierarchy.Count Step 1
If Nothing
= hierarchy.Item(i) Then
' Exit
"Address book is invalid"
End If
Next i